Why can't you access the size of a new[]'d array?
Posted
by Poita_
on Stack Overflow
See other posts from Stack Overflow
or by Poita_
Published on 2010-03-09T00:06:54Z
Indexed on
2010/03/09
0:21 UTC
Read the original article
Hit count: 487
When you allocate an array using new []
, why can't you find out the size of that array from the pointer? It must be known at run time, otherwise delete []
wouldn't know how much memory to free...
Unless I'm missing something?
© Stack Overflow or respective owner